<template>
  <div class="dwForm">
    <a-modal
      :title="'重置密码'"
      :visible="visible"
      :confirm-loading="confirmLoading"
      @ok="handleOk"
      @cancel="visible=false"
    >
      <div>
        <a-form-model :model="form" >
  		    <a-form-model-item label="新密码">
  		      <a-input-password v-model="form.password" placeholder="" />
  		    </a-form-model-item>
  		   	<a-form-model-item label="确认密码">
  		      <a-input-password v-model="form.password1" placeholder="" />
  		    </a-form-model-item>
		    </a-form-model>
      </div>
    </a-modal>
  </div>
</template>

<script>

export default {
  name: 'ResetPwd',
  mixins:[],
  props: {
    
  },
  data() {
    return {
      visible:false,
      confirmLoading:false,
      form:{},
      row:{}
    }
  },

  methods: {
  	open(row){
  		this.row = row;
  		this.visible = true;
  	},
    handleOk(){
      console.log(this.form)
    	if(this.form.password==this.form.password1){
    		const params = {
    			id:this.row.id,
    			pwd:this.$utils.toMd5(this.form.password)
    		}
    		this.$net.resetPwd(params)
    		.then(res=>{
    			this.$success('重置密码成功')
    			this.visible = false;
    		})
    	}else{
    		this.$info('两次输入的密码不一致')
    	}
    }
  }
}
</script>

<style scoped>
.line{
  text-align: center;
}
</style>

